#include<stdio.h>

int main()
{
	int n;
	scanf("%d", &n);
	int i;
	printf("奇数位打印:\n");
	for (i = 0; i < 32; i = i + 2)
	{
		if ((n >> i) & 1 == 1)
		{
			printf("1 ");
		}
		else
		{
			printf("0 ");
		}
	}
	printf("\n");
	printf("偶数位打印:\n");
	for (i = 1; i < 32; i = i + 2)
	{
		if ((n >> i) & 1 == 1)
		{
			printf("1 ");
		}
		else
		{
			printf("0 ");
		}
	}
	return 0;
}